<template>
  <div class="log-container">
    <template v-if="logs.length">
      <view v-for="(log, index) in logs" :key="index" class="log-item">
        <div class="log_item_title">
          <text>{{ log.createTime }}</text> 操作人：{{ log.createUserName }}
        </div>
        <div :class="{ 'red-text': log.logType == 30 || log.logType == 60 }">{{ log.logContent }}</div>
      </view>
    </template>
    <u-empty mode="data" v-else> </u-empty>
  </div>
</template>

<script>
export default {
  name: "",
  props: {
    infoData: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {
    };
  },
  methods: {},
  computed: {
    logs() {
      if (Object.keys(this.infoData).length) {
        return this.infoData.logList;
      } else {
        return [];
      }
    },
  },
  created() {},
};
</script>

<style scoped lang="scss">
.log-container {
  padding: 20rpx 30rpx;
  font-size: 28rpx;
}

.log-item {
  display: flex;
  flex-direction: column;
  gap: 20rpx;
  margin-bottom: 40rpx;
  .log_item_title {
    display: flex;
    gap: 20rpx;
  }
}

.red-text {
  color: red; /* 设置为红色 */
  word-break: break-all;
}
</style>
